class Tag:
  start = 0
  end = 0
  def __init__(self, start, end):
    self.start = start
    self.end = end
  def html():
    pass

class Link(Tag):
  href = ''
  anchor = ''
  def __init__(self, href, anchor, start, end):
    Tag.__init__(self, start, end)
    self.href = href
    self.anchor = anchor

  def html(self):
    return "<a href='%s' class='bc_link'>%s</a>"%(self.href, self.anchor)

class Tooltip(Tag):
  link = None
  def __init__(self, link, start, end):
    Tag.__init__(self, start, end)
    self.link = link
  def html(self):
    pass

class Highlight(Tag):
  text = ''
  def __init__(self, text, start, end):
    Tag.__init__(self, start, end)
    self.text = text
  def html(self):
    return "<span class='bc_hightlight'>%s</span>" % (self.text)

class Source:
  src = ''
  path = ''
  tags = []
  def __init__(self, src, path):
    self.src = src
    self.path = path
  def add_keyword(self, start, end, text):
    tags.append(Highlight(text, start, end))
  def add_function_call(self, to, usr, func, start, end):
    href = "%s.html#%s"%(to, usr)
    link = Link(href, func, start, end)
  def add_function_def(self, usr, start, end):
    pass
  def add_tooltip(self, sourcerange, tip):
    pass
  def html():
    pass

link = Link('test#123', 'test', 0, 1)
print link.html()
